import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    city: '北京',
    optimization: {},
    cartStatus: true,
    cartNum: 0
  },
  mutations: {
    changeCity (state, city) {
      state.city = city
    },
    getOptimization (state, optimization) {
      state.optimization = optimization
    },
    changeCartStatus (state, cartStatus) {
      state.cartStatus = cartStatus
    },
    addCratNum (state, cartNum) {
      state.cartNum = cartNum
    }
  },
  actions: {

  }
})
